package com.newcapec.shiro;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.util.StringUtils;
import org.xkp.ColorPrint;

import java.net.InetAddress;
import java.net.UnknownHostException;

@SpringBootApplication
public class ShirodemoApplication {

    public static void main(String[] args) throws UnknownHostException {

       ConfigurableApplicationContext applicationContext =SpringApplication.run(ShirodemoApplication.class, args);

        Environment environment=applicationContext.getEnvironment();
       String ip=InetAddress.getLocalHost().getHostAddress();
       String port=environment.getProperty("server.port");
       String path=environment.getProperty("server.servlet.context-path");
       if(path==null ){
           path="";
       }
       ColorPrint.bluePrintln("locatl访问的位置：\t \thttp://localhost:"+port+path);
    }

}
